package com.demoworld;

/**
 * Created by li_wb on 2018/1/24.
 */
public class Main {
    public static void main(String[] args) {
        Entity entity = JsonUtils.fromJson(strJson, Entity.class);
        System.out.println(JsonUtils.toPrettyJson(entity));
    }

    private static String strJson = "{\n" +
            "  \"host\": \"http://api.example.com/\",\n" +
            "  \"ip\":\"\",\n" +
            "  \"port\":\"\",\n" +
            "  \"mock\":[{\n" +
            "    \"pathname\":\"/test\",\n" +
            "    \"tpl\":\"test.mock\",\n" +
            "    \"statusCode\": 200,\n" +
            "    \"delay\": 5000\n" +
            "  }, {\n" +
            "    \"pathname\":\"/test/deep/path\",\n" +
            "    \"tpl\":\"test2.mock\"\n" +
            "  }, {\n" +
            "    \"pathname\":\"/rest/path/{arg1}/{arg2}-{arg3}\",\n" +
            "    \"tpl\":\"rest.mock\"\n" +
            "  }, {\n" +
            "    \"pathname\":\"/rest/{method}/{arg1}/{arg2}-{arg3}\",\n" +
            "    \"apiKey\":\"method=list\",\n" +
            "    \"tpl\":\"rest.list.mock\"\n" +
            "  }, {\n" +
            "    \"pathname\":\"/rest\",\n" +
            "    \"apiKey\":\"method=list\",\n" +
            "    \"tpl\":\"rest.method.list.mock\"\n" +
            "  }]\n" +
            "}";
}
